Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45885: Don't un-adapt COMPARE_OP when collecting stats #31516

Merged
merged 3 commits into from
Feb 23, 2022

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Feb 22, 2022

The current stats obscure the fact that "not followed by conditional jump" accounts for a significant portion of possible COMPARE_OP hits. This patch takes the same approach that BINARY_OP uses of only un-adapting the instruction when stats aren't being collected.

New stats:

COMPARE_OP

specialization stats for COMPARE_OP family
Kind Count Ratio
unquickened 7362156 0.4%
specialization.deferred 288102012 17.2%
specialization.deopt 15642 0.0%
hit 1374191464 82.3%
miss 959440 0.1%

Specialization attempts

Count Ratio
Success 373171 7.4%
Failure 4650804 92.6%
Failure kind Count Ratio
not followed by cond jump 2647332 56.9%
float long 665643 14.3%
set 580212 12.5%
different types 151788 3.3%
bool 137583 3.0%
other 127248 2.7%
tuple 120230 2.6%
big int 101401 2.2%
bytes 52839 1.1%
baseobject 42585 0.9%
list 23036 0.5%
string 706 0.0%
long float 201 0.0%

https://bugs.python.org/issue45885

Copy link
Member

@sweeneyde sweeneyde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice -- this puts this failure kind on equal footing with the other failure kinds so the stats are more honest.

@markshannon
Copy link
Member

👍

@markshannon markshannon merged commit 375a56b into python:main Feb 23, 2022
@brandtbucher brandtbucher deleted the compare-op-stats branch July 21, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants